package com.ess.portal.service;

import java.util.List;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ess.common.EssBaseService;
import com.ess.system.service.MenuService;
import com.ess.system.service.model.EssMenu;

@RestController
public class PortalService
{
    MenuService ms;

    public PortalService(EssBaseService bseService)
    {
        this.ms = bseService.get(MenuService.class);
    }

    @RequestMapping("/menu")
    public String menu()
    {
        return "test...";
    }

    @RequestMapping("/addMenu")
    public void addMenu(EssMenu menu)
    {
        ms.add(menu);
    }

    @RequestMapping("/listMenu")
    public List<EssMenu> listMenu(long id)
    {
        List<EssMenu> menus = ms.chindMenu(id);
        System.out.println(menus.get(0).getId());
        return menus;
    }
}
